<?php

    function mydate($date)
    {
       $day=substr($date,8,2);
       //$mymonth = array('January','February','March','April','May','June','July','August','September','October','November','December');
       $mymonth = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
       $month=substr($date,5,2);
       $year=substr($date,0,4);
       $temp=$day.' '.$mymonth[$month-1].' '.$year;
       return $temp;
    }
    $baseurl = current(split("index", $_SERVER['PHP_SELF']));
    echo "<p class='banner' align='right' onmousedown='tekan(event);' onmousemove='gerak(event);' onmouseup='lepas();' onmouseout='lepas();'> <a href='Javascript:close_slip()'> <img src='".$baseurl."/img/no4.gif' alt='[ X ]'></a></p>";
    echo "<table class='detail_jobs'>";
        echo "<tr><td class='left'>Position</td><td>".$data['Job']['position']."</td></tr>";
        echo "<tr><td class='left'>Location</td><td>".$data['City']['name']."</td></tr>";
        echo "<tr><td class='left'>Qualification</td><td>".$data['Academic']['name']."</td></tr>";
        if($data['Job']['salary']==0)
        { $temp=SALARY_0; }
        if($data['Job']['salary']==1)
        { $temp=SALARY_1; }
        if($data['Job']['salary']==2)
        { $temp=SALARY_2; }
        if($data['Job']['salary']==3)
        { $temp=SALARY_3; }
        if($data['Job']['salary']==4)
        { $temp=SALARY_4; }
        echo "<tr><td class='left'>Salary</td><td>".$temp."</td></tr>";

        $temp='';
        echo "<tr><td class='left'>Job Category</td><td>";
        foreach($data['Field'] as $field)
        { $temp.= " ".$field['name'].","; }
        $temp=substr($temp,0,strlen($temp)-1);
        echo $temp."</td></tr>";
        
        $temp= ""; 
        if($data['Job']['parttime'])
        { $temp.= "Part Time,"; }
        if($data['Job']['fulltime'])
        { $temp.= "Full Time,"; }
        if($data['Job']['freelance'])
        { $temp.= "Freelance,"; }
        if($data['Job']['contract'])
        { $temp.= "Contract,"; }
        if($data['Job']['temporary'])
        { $temp.= "Temporary,"; }
        $temp=substr($temp,0,strlen($temp)-1);
        echo "<tr><td class='left'>Type</td><td>".$temp."</td></tr>";

        $temp= ""; 
        if($data['Job']['entry'])
        { $temp= "Entry Level"; }
        if($data['Job']['senior'])
        { $temp= "Senior"; }
        if($data['Job']['top'])
        { $temp= "Top"; }
        if($data['Job']['middle'])
        { $temp= "Middle"; }
        echo "<tr><td class='left'>Career Level</td><td>".$temp."</td></tr>";



        echo "<tr><td class='left'>Posted Until</td><td>".mydate($data['Job']['end_date'])."</td></tr>";
    echo "</table>";
?>